/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pradoeditor.comun;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author jaimeg
 */
public class ItemProject
{
    private String name = "";
    private String path = "";
    private List<ItemProject> childrens = new ArrayList<ItemProject>();

    public ItemProject()
    {

    }

    public ItemProject(String name)
    {
        this.name = name;
    }

    public ItemProject(String name, String path)
    {
        this.name = name;
        this.path = path;
    }

    public String getName()
    {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name)
    {
        this.name = name;
    }

    /**
     * @return the path
     */
    public String getPath() {
        return path;
    }

    /**
     * @param path the path to set
     */
    public void setPath(String path) {
        this.path = path;
    }

    public List<ItemProject> getChildrens()
    {
      return childrens;
    }

    @Override
    public String toString()
    {
        return name;
    }

    //TODO: Pendiente por implementar
    public String getType()
    {
        String ext = (path.lastIndexOf(".")==-1)?"":path.substring(path.lastIndexOf(".")+1,path.length());
        return ext;
    }

     //TODO: Pendiente por implementar
    public String getIcon()
    {
        return "";
    }
}
